/*
 * Location.h
 *
 *  Created on: Aug 22, 2010
 *      Author: Satish
 */

#ifndef LOCATION_H_
#define LOCATION_H_

#define UBOUND 150 //defines upper bound for the coordinate value
#define LBOUND 0 //defines lower bound for the coordinate value

#include <stdexcept>
#include<iostream>

using namespace std;

class Location
{
private:

	int mXcord;
	int mYcord;
public:

	Location(); //default constructor

	//constructor with error checking for bounds
	Location(int aXcord,int aYcord)
	{
		mXcord =aXcord;
		mYcord =aYcord;
	}

	//accessors and mutators
	int getx()const
	{
		return mXcord;
	}

	int gety()const
	{
		return mYcord;
	}

	void setx(int aXcord)
	{
		mXcord = aXcord;
	}

	void sety(int aYcord)
	{
		mYcord = aYcord;
	}

	//input operator overload to read location from input file
	friend istream& operator>>(istream& in,Location& p)
	{
		in >> p.mXcord >> p.mYcord;
		return in;
	}

	//display the locations of computers in  a network
	void display()
	{
		cout<<"("<<getx()<<","<<gety()<<")";
	}

	virtual ~Location();

};

#endif /* Location_H_ */
